﻿using PmSoft.Core.Domain.Entities;
using PmSoft.Core.Domain.Entities.Caching;
using PmSoft.Data.Abstractions.Attributes;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace Demo.Domains.Entities.Sys;

/// <summary>
/// 机关单位信息
/// </summary>
[Table("sys_dept")]
[CacheSetting(true)]
[Description("单位部门")]
[Auditable("sys")]
public class SysDept : IEntity<int>
{
	/// <summary>
	/// 单位ID
	/// </summary>
	[PrimaryKey("id")]
	public int Id { get; set; }

	/// <summary>
	/// 单位名称 
	///</summary>
	[Column("name")]
	public string Name { get; set; } 
	/// <summary>
	/// 省编号 
	///</summary>
	[Column("province_num")]
	public int? ProvinceNum { get; set; }
	/// <summary>
	/// 市编号 
	///</summary>
	[Column("city_num")]
	public int? CityNum { get; set; }
	/// <summary>
	/// 区编号 
	///</summary>
	[Column("region_num")]
	public int? RegionNum { get; set; }

	#region IEntity
	[NotMapped]
	object IEntity.Id => Id;
	#endregion

}